#ifndef NETSET_H
#define NETSET_H

#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QHostAddress>

class NetSet : public QObject{
    Q_OBJECT

public:
    NetSet(QString ipcon);
    ~NetSet(void);

private:
    QTcpServer * ser_sock = nullptr;
    QTcpSocket * cli_sock = nullptr;
    QString ip;
    quint32 port;

public slots:
    void mainWindowListenCon(void);

    void netSetRecvMainWindow(QString info);

private slots:
    void netSetSendListenErrorMain(QAbstractSocket::SocketError socketError);

signals:
    void netListenDefeat(QAbstractSocket::SocketError socketError);

    void netConnect(void);

    void netDisconnect(void);

    void netSetSendDataToMainWindow(QString info);

};

#endif // NETSET_H
